package com.testmanager.testmananger.quantitative.mapper;

import com.testmanager.testmananger.quantitative.domain.WorkerEntity;
import com.testmanager.testmananger.quantitative.dto.WorkerDto;

public class WorkerMapper {

    public static  WorkerDto toWorkerDto(WorkerEntity workerEntity){
        WorkerDto workerDto = new WorkerDto();
        return  workerDto.setId(workerEntity.getId())
                .setUserName(workerEntity.getUserName())
                .setUserId(workerEntity.getUserId());
    }

    public static WorkerEntity toWorkerEntity(Long ownerNo,WorkerDto workerDto){

        WorkerEntity workerEntity = new WorkerEntity();
        return workerEntity.setId(workerDto.getId())
                .setUserId(workerDto.getUserId())
                .setOwnerNo(ownerNo)
                .setUserName(workerDto.getUserName());
    }
}
